//
//  CERuleListCell.m
//  digitalCurrency
//
//  Created by 来迎宾 on 2019/4/4.
//  Copyright © 2019年 XinHuoKeJi. All rights reserved.
//

#import "CERuleListCell.h"

@implementation CERuleListCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self makeviews];
        self.selectionStyle  = UITableViewCellSelectionStyleNone;
        self.backgroundColor = [UIColor blackColor];
    }
    return self;
}

- (void)makeviews {
    
    //__weak typeof(self)weakself = self;
    
    CGFloat viewwidth = SCREEN_WIDTH - 30;
    
    UILabel *levelLabel = [[UILabel alloc] init];
    levelLabel.text = LocalizationKey(@"一等奖");
    levelLabel.textColor = [UIColor whiteColor];
    levelLabel.font = [UIFont systemFontOfSize:14];
    [self.contentView addSubview:levelLabel];
    self.levelLabel = levelLabel;
    [levelLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(15);
        make.top.mas_equalTo(10);
        make.width.mas_equalTo(viewwidth/3.0);
        make.height.mas_equalTo(15);
    }];
    
    UILabel *midLabel = [[UILabel alloc] init];
    midLabel.text = @"2-3";
    midLabel.textColor = [UIColor whiteColor];
    midLabel.font = [UIFont systemFontOfSize:14];
    midLabel.textAlignment = NSTextAlignmentCenter;
    [self.contentView addSubview:midLabel];
    self.midLabel = midLabel;
    [midLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.mas_equalTo(self.mas_centerX);
        make.top.mas_equalTo(10);
        make.width.mas_equalTo(viewwidth/3.0);
        make.height.mas_equalTo(15);
    }];
    
    UILabel *lastLabel = [[UILabel alloc] init];
    lastLabel.text = @"10.0%";
    lastLabel.textColor = [UIColor whiteColor];
    lastLabel.font = [UIFont systemFontOfSize:14];
    [self.contentView addSubview:lastLabel];
    lastLabel.textAlignment = NSTextAlignmentRight;
    self.lastLabel = lastLabel;
    [lastLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(15+2*viewwidth/3.0);
        make.top.mas_equalTo(10);
        make.width.mas_equalTo(viewwidth/3.0);
        make.height.mas_equalTo(20);
    }];
    
    
    
}


@end
